From 8e3b29caf832d29ffdcc1eebc14d5954674904ab Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Mon, 10 Nov 2003 17:53:50 +0000 Subject: [PATCH] bitkeeper revision 1.587 (3fafd0aetHCEr89pQ3yPEASCbKFapg) xen_netwatch_redhatscript: new file xen_netwatch.c: More xen_netwatch fixes. --- .rootkeys | 1 + tools/misc/xen_netwatch.c | 4 ++-- tools/misc/xen_netwatch_redhatscript | 33 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100755 tools/misc/xen_netwatch_redhatscript diff --git a/.rootkeys b/.rootkeys index e3a2af6627..50045fa3b5 100644 --- a/.rootkeys +++ b/.rootkeys @@ -192,6 +192,7 @@ 3f13d81eQ9Vz-h-6RDGFkNR9CRP95g tools/misc/xen_nat_enable 3f13d81e6Z6806ihYYUw8GVKNkYnuw tools/misc/xen_nat_enable.README 3fafbef1fJFKCcJLq-ffpauvpM10jQ tools/misc/xen_netwatch.c +3fafd0abTbQjsCr5W3DDyNdqdJezrA tools/misc/xen_netwatch_redhatscript 3f1668d4F29Jsw0aC0bJEIkOBiagiQ tools/misc/xen_read_console.c 3f87ba90EUVPQLVOlFG0sW89BCwouQ tools/misc/xen_refresh_dev.c 3f72f1bdJPsV3JCnBqs9ddL9tr6D2g xen/COPYING diff --git a/tools/misc/xen_netwatch.c b/tools/misc/xen_netwatch.c index d6624d5e30..9e1194e329 100644 --- a/tools/misc/xen_netwatch.c +++ b/tools/misc/xen_netwatch.c @@ -30,8 +30,8 @@ #include #include -#define DEFAULT_SCRIPT "/var/xen/netwatch" -#define DEFAULT_LOGFILE "/etc/xen/netwatch" +#define DEFAULT_SCRIPT "/etc/xen/netwatch" +#define DEFAULT_LOGFILE "/var/xen/netwatch" #define LOG(_f, _a...) \ do { \ diff --git a/tools/misc/xen_netwatch_redhatscript b/tools/misc/xen_netwatch_redhatscript new file mode 100755 index 0000000000..1104abd342 --- /dev/null +++ b/tools/misc/xen_netwatch_redhatscript @@ -0,0 +1,33 @@ +#!/bin/sh + +# Example xen_netwatch script for Red Hat systems. +# If the network interface goes up or down then standard Red Hat +# scripts are executed. This may be necessary to reconfigure default +# routes, for example. +# +# This script should be placed at /etc/xen/netwatch +# You should make sure that the directory /var/xen/ exists. +# +# Something like the follwoing should be placed in a startup script +# such as /etc/rc.d/rc.local: +# +# if [ -x /usr/bin/xen_netwatch ]; then +# if [ -a /etc/xen/netwatch ]; then +# mkdir -p /var/xen +# /usr/bin/xen_netwatch +# fi +# fi + +cd /etc/sysconfig/network-scripts || exit 1 + +if [ "x$2" == "xup" ]; then + if [ -x ./ifup ]; then + ./ifup $1 + fi +fi + +if [ "x$2" == "xdown" ] ; then + if [ -x ./ifdown ]; then + ./ifdown $1 + fi +fi -- 2.30.2